<script>

    layui.use(['jquery','table','upload','layer','element','form','laydate'],function () {
        let $ = layui.$, table = layui.table, form = layui.form,
            layer = layui.layer, laydate = layui.laydate,upload = layui.upload;
        laydate.render({elem:'#open_start',type:'time'});
        laydate.render({elem:'#open_end',type:'time'});

        //省市联动
        form.on('select(province)',function (obj) {
            let province = obj.value;
            $("#city").html('<option value=""></option>');
            if (province) {
                $.ajax({
                    url: "/city",
                    data: {province: province},
                    dataType: "json",
                    success: function (res) {
                        $.each(res,function (index, value) {
                            $("#city").append('<option value="'+value+'">'+value+'</option>');
                        })
                        form.render('select')
                    }
                })
            }
        })

        //市区联动
        form.on('select(city)',function (obj) {
            let city = obj.value;
            $("#district").html('<option value=""></option>');
            if(city) {
                $.ajax({
                    url: "/district",
                    data: {city: city},
                    dataType: "json",
                    success: function (res) {
                        $.each(res,function (index, value) {
                            $("#district").append('<option value="'+value+'">'+value+'</option>');
                        })
                        form.render('select')
                    }
                })
            }
        })
    })
</script>
<link href="/baidu-editor/themes/default/css/umeditor.min.css" type="text/css" rel="stylesheet">
<script src="/baidu-editor/third-party/jquery.min.js"></script>
<!-- 配置文件 -->
<script type="text/javascript" src="/baidu-editor/umeditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/baidu-editor/umeditor.min.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UM.getEditor('container');
</script>
